package com.airy.apprepairequipment.service.impl;

import com.airy.apprepairequipment.common.utils.PageUtils;
import com.airy.apprepairequipment.common.utils.Query;
import com.airy.apprepairequipment.dao.SdevLoopgroupDao;
import com.airy.apprepairequipment.entity.SdevLoopgroupEntity;
import com.airy.apprepairequipment.service.SdevLoopgroupService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("sdevLoopgroupService")
public class SdevLoopgroupServiceImpl extends ServiceImpl<SdevLoopgroupDao, SdevLoopgroupEntity> implements SdevLoopgroupService {

    @Autowired
    SdevLoopgroupDao sdevLoopgroupDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SdevLoopgroupEntity> page = this.page(
                new Query<SdevLoopgroupEntity>().getPage(params),
                new QueryWrapper<SdevLoopgroupEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<SdevLoopgroupEntity> getByfstrDeviceid(String fstrDeviceid) {
        return sdevLoopgroupDao.getByfstrDeviceid(fstrDeviceid);
    }

}